<template>
    <div class="top-view">
        <lay-input prefix-icon="layui-icon-search" allow-clear></lay-input>
        <div class="mright">
            Jack Yang
            <i class="layui-icon layui-icon-user"></i>
            <lay-badge type="dot">
                <i class="layui-icon layui-icon-notice"></i>
            </lay-badge>
        </div>
    </div>
    <div class="echart" ref="chart"></div>
    <div class="list">
        <div class="list-container">
            <div class="item">
                <lay-icon class="ico" type="layui-icon-fire" color="#5FB878" size="18px"></lay-icon>
                <div>这是一个demo，工作联系，加我微信yangmingtaox</div>
            </div>
            <div class="item">
                <lay-icon class="ico" type="layui-icon-logout" color="#1E9FFF" size="18px"></lay-icon>
                <div>这是一个demo，工作联系，加我微信yangmingtaox</div>
            </div>
            <div class="item">
                <lay-icon class="ico" type="layui-icon-service" color="#FFB800" size="18px"></lay-icon>
                <div>这是一个demo，工作联系，加我微信yangmingtaox</div>
            </div>
            <div class="item">
                <lay-icon class="ico" type="layui-icon-screen-restore" color="#FF5722" size="18px"></lay-icon>
                <div>这是一个demo，工作联系，加我微信yangmingtaox</div>
            </div>
        </div>
        <div class="bottom-right">
        </div>
    </div>
</template>

<script lang="ts" setup>
import * as echarts from "echarts";
import { onMounted, ref } from "vue";
let chart = ref();
onMounted(function () {
    const mychart = echarts.init(chart.value)
    let option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: [
            {
                type: 'category',
                data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis: [
            {
                type: 'value'
            }
        ],
        series: [
            {
                name: 'Direct',
                type: 'bar',
                barWidth: '60%',
                data: [10, 52, 200, 334, 390, 330, 220]
            }
        ]
    };

    option && mychart.setOption(option);
})
</script>

<style scoped>
.top-view {
    display: flex;
    align-items: center;

    div:first-child {
        flex: 1;
        margin-right: 40px;
    }

    div {
        display: flex;
        width: fit-content;
        justify-items: center;
        width: fit-content;
    }

    div.mright {
        display: flex;
        margin-left: auto;
        align-items: center;
        gap: 10px;
    }
}

.echart {
    height: 300px;
    width: 100%;
}

.ico {
    padding: 2px;
}

.item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 10px;
    padding-top: 10px;
    border-bottom: .05em solid #ccc;
}

.list {
    display: flex;
    align-items: center;
}

.bottom-right {
    flex: 1;
    height: 200px;
    background: url(../assets/meinv.jpeg);
    background-position: 60% 80%;
    clip-path: polygon(100% 0%, 75% 50%, 100% 100%, 25% 100%, 0% 50%, 25% 0%);
}
</style>